import request from "@/utils/request";
import formurlencoded from "form-urlencoded";

// console.log(formurlencoded.default({a:1,b:2}));

export function login(parameter) {
  return request({
    url: "/admin/doLogin",
    method: "post",
    data: formurlencoded(parameter),
  });
}

export function getInfo(token) {
  return request({
    url: "/admin/console.html",
    method: "get",
    params: { token },
  });
}

export function logout() {
  return request({
    url: "/admin/exit",
    method: "get",
  });
}

export function sendPhoneMsg(phone) {
  return request({
    url: '/admin/sendPhoneMsg?phone=' + phone,
    method: 'get'
  })
}

export function updatePassword(data) {
  return request({
    url: '/admin/updatePassword',
    method: 'post',
    data: data
  })
}
